export default async function api({url,method, data,content}) {
	var [error, res] = await uni.request({
		url: 'https://www.norwamd.cn/apps' + url,
		method,
		data,
		header: {
			'Content-Type':content||'application/json',
			'Authorization': uni.getStorageSync('token')
		}
	});
	if (res.statusCode === 200) {
		if (res.data.success === false) {
			uni.showToast({
				title: res.data.msg,
				duration: 2000,
				icon: 'none'
			});
			return Promise.reject(res.data.msg)
		} else {
			return Promise.resolve(res.data)	//返回key值分data，list。
		}
	} else {
		uni.showToast({
			title: '网络异常，稍后重试',
			duration: 2000,
			icon: 'none'
		});
		return Promise.reject('网络异常，稍后重试')
	}
}
